﻿Imports DTO
Imports System.Data.Linq

Public Class SachThanhLyDao
    Public Shared Sub Them(ByVal t As SachThanhLy)
        Dim db As New ThuVienDataContext()
        db.SachThanhLies.InsertOnSubmit(t)
        db.SubmitChanges()
    End Sub

    Public Shared Sub CapNhat(ByVal tl As SachThanhLy)
        Dim db As New ThuVienDataContext()
        Dim tly = (From t In db.SachThanhLies Where t.MS = tl.MS Select t).Single

        tly.Ly_do = tl.Ly_do
        tly.Ngay_thanh_ly = tl.Ngay_thanh_ly

        db.SubmitChanges()
    End Sub
End Class
